import { ColumnProps } from "@/components/Table/type";
import { SchemaProps } from "@/components/Form/type";
export const columns: ColumnProps[] = [
  { type: "index", label: "#", width: 50 },
  { prop: "dictValue", label: "字典键值", search: { el: "input" } },
  { prop: "dictLabel", label: "字典标签", search: { el: "input" } },
  { prop: "remark", label: "字典备注" },
  { prop: "orderNum", label: "显示顺序", width: 150 },
  { prop: "action", label: "操作", width: 150, fixed: "right" }
];

export const schemas: SchemaProps[] = [
  {
    field: "dictValue",
    label: "字典键值",
    required: true,
    disabled: row => {
      return !!row.id;
    }
  },
  {
    field: "dictLabel",
    label: "字典标签",
    required: true
  },
  { field: "remark", label: "字典备注" },
  {
    field: "orderNum",
    label: "显示顺序",
    el: "number",
    elProps: {
      controlsPosition: "right",
      precision: 0,
      style: {
        width: "100%"
      }
    }
  }
];
